<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!-- 右侧区域 -->
		<div class="right">
			<div class='hd_title'>
				<strong>标签云</strong>	
			</div>
			<div id="tagBox" class='tags'>
						<?php
			$tagData = K('Tag')->limit(5)->all();
			foreach($tagData as $field):
			$field['url'] = U('List/index',array('tid'=>$field['tid']));
		?>
		
					<a href="<?php echo $field['url'];?>"><?php echo $field['tagname'];?></a>	
				
		<?php
			endforeach;
		?>
			</div>
			<div class='hd_title'>
				<strong>热门文章</strong>	
			</div>
			<ul class='arc_list'>
				<?php
	//如果有此参数，就是要实现分页效果
	if(0){
		//总条数
		$total = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%热门%'")->count();
		$pageObj = new Page($total,0,5);
		$page = $pageObj->show();
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%热门%'")->limit($pageObj->limit())->order('sendtime DESC')->all();
	}else{
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%热门%'")->limit(2)->order('sendtime DESC')->all();
	}
	foreach($arcData as $field):
	//评论总条数
	$field['total'] = K('Comment')->where("article_aid=" . $field['aid'])->count();
	//文章地址
	$field['url'] = getArcUrl($field['is_html'],$field['htmldir'],$field['aid']);
	//文章缩略图
	$field['thumb'] = "http://localhost/cms_edu/" . $field['thumb'];
?>

					<li>
						<div class='image'>
							<a href="<?php echo $field['url'];?>">
								<img src="<?php echo $field['thumb'];?>" alt=""/>
							</a>
						</div>
						<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?>...</a></h2>
						<p>
							<em><?php echo date('m-d',$field['sendtime']);?></em><span><?php echo $field['total'];?>条评论</span>
						</p>
					</li>
				
<?php
	endforeach
?>	
			</ul>
			<div class='hd_title'>
				<strong>推荐文章</strong>	
			</div>
			
			<ul class='arc_list'>
				<?php
	//如果有此参数，就是要实现分页效果
	if(0){
		//总条数
		$total = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%推荐%'")->count();
		$pageObj = new Page($total,0,5);
		$page = $pageObj->show();
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%推荐%'")->limit($pageObj->limit())->order('sendtime DESC')->all();
	}else{
		$arcData = M()->join('__article__ a JOIN __category__ c ON a.category_cid=c.cid')->where("attr LIKE '%推荐%'")->limit(2)->order('sendtime DESC')->all();
	}
	foreach($arcData as $field):
	//评论总条数
	$field['total'] = K('Comment')->where("article_aid=" . $field['aid'])->count();
	//文章地址
	$field['url'] = getArcUrl($field['is_html'],$field['htmldir'],$field['aid']);
	//文章缩略图
	$field['thumb'] = "http://localhost/cms_edu/" . $field['thumb'];
?>

					<li>
						<div class='image'>
							<a href="<?php echo $field['url'];?>">
								<img src="<?php echo $field['thumb'];?>" alt=""/>
							</a>
						</div>
						<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?>...</a></h2>
						<p>
							<em><?php echo date('m-d',$field['sendtime']);?></em><span><?php echo $field['total'];?>条评论</span>
						</p>
					</li>
				
<?php
	endforeach
?>	
			
			</ul>
		</div>
		<!-- 右侧区域结束 -->